Opened 14 years ago
Closed 14 years ago
#666 closed defect (fixed)
ST_DumpPoints is not null safe
Reported by: | robe | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 1.5.3 |
Component: | postgis | Version: | 1.5.X |
Keywords: | history | Cc: |
Description (last modified by )
SELECT ST_DumpPoints(foo1.the_geom) FROM ((SELECT CAST(Null As geometry) As the_geom)) As foo1;
Gives error -
ERROR: Unexpected error while dumping geometry <NULL> CONTEXT: SQL function "st_dumppoints" statement 1
Change History (5)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
I was wondering if it wouldn't be sufficient to just mark this function as STRICT like the way ST_Dump is marked. Do people think its necessary to even put logic about NULL handling in the function if the function is marked as strict.
Even though this is an SQL function, I don't see any benefit of keeping it non-strict since it could never utilize spatial indexes anyway.
comment:5 by , 14 years ago
Description: | modified (diff) |
---|---|
Keywords: | history added |
Resolution: | → fixed |
Status: | new → closed |
Fixed at r7360 for 1.5 and r7361 for PostGIS 2.0.0. Note the _ST_DumpPoints still has an issue thought no one would be calling that directly. Can't make that strict since it should have nulls passed in. For a more permanent solution - we might want to just go with yabo's suggestion.
With my fix, dumping a NULL will return no records which is hmm okay with me.
Here's a patch. I'm not sure of what should be in the regress test though. Empty lines ? NULL ? I can't run make check from where I am now.